﻿<Window x:Class="SchemeManager.SelectItem"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:control="http://schemas.aspitalia.com/Ricciolo/Controls" 
        Title="选择项目--双击项目选择" Height="480" Width="590" WindowStyle="ToolWindow" WindowStartupLocation="CenterScreen">


    <Window.Resources>
        <!--
        XPath语法：
        / 从根节点选取 　　
        // 从匹配选择的当前节点选择文档中的节点，而不考虑它们的位置 　　
        . 选取当前节点 　　
        .. 选取当前节点的父节点 　　
        @ 选取属性-->
        <XmlDataProvider x:Key="myData" Source="Datas/MeterMark.xml">

        </XmlDataProvider>


    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
        <TabControl Grid.Row="0" Margin="10" Name="TabMain" Effect="{DynamicResource Normal}">
            <TabItem Header="基本参数" Style="{DynamicResource TabItemStyle1}">
                <DataGrid Name="Grid_Basic"              
                BorderBrush="{DynamicResource selectedStroke}" 
                RowHeight="24" 
                VerticalContentAlignment="Center" 
                BorderThickness="1" 
                RowStyle="{DynamicResource DataGridRowStyle1}" 
                VerticalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}" 
                CellStyle="{DynamicResource DataGridCellStyle1}" 
                HorizontalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}"  
                IsSynchronizedWithCurrentItem="True" 
                CanUserSortColumns="False" 
                FontSize="12" 
                IsReadOnly="False" 
                AutoGenerateColumns="False"
                HeadersVisibility="Column" 
                CanUserReorderColumns="False"
                CanUserAddRows="False"
                DataContext="{Binding Source={StaticResource myData}}"
                ItemsSource="{Binding XPath=DataMark/ParaGroup[5]/Item}"
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding XPath=@Name}" Header="项目名称" Width="100*"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Mark}" Header="数据标识" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Data}" Header="数据域" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@ReviewType}" Header="操作类型" Width="80"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <!--<TabItem Header="费控功能" Style="{DynamicResource TabItemStyle1}">
                <DataGrid  Name="Grid_CostControl"             
                BorderBrush="{DynamicResource selectedStroke}" 
                RowHeight="24" 
                VerticalContentAlignment="Center" 
                BorderThickness="1" 
                RowStyle="{DynamicResource DataGridRowStyle1}" 
                VerticalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}" 
                CellStyle="{DynamicResource DataGridCellStyle1}" 
                HorizontalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}"  
                IsSynchronizedWithCurrentItem="True" 
                CanUserSortColumns="False" 
                FontSize="12" 
                IsReadOnly="False" 
                AutoGenerateColumns="False"
                HeadersVisibility="Column" 
                CanUserReorderColumns="False"
                CanUserAddRows="False"
                DataContext="{Binding Source={StaticResource myData}}"
                ItemsSource="{Binding XPath=DataMark/ParaGroup[2]/Item}"
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding XPath=@Name}" Header="项目名称" Width="100*"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Mark}" Header="数据标识" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Data}" Header="数据域" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Review}" Header="复核" Width="80"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>-->
            <TabItem Header="一类参数" Style="{DynamicResource TabItemStyle1}">
                <DataGrid   Name="Grid_FirstPara"           
                BorderBrush="{DynamicResource selectedStroke}" 
                RowHeight="24" 
                VerticalContentAlignment="Center" 
                BorderThickness="1" 
                RowStyle="{DynamicResource DataGridRowStyle1}" 
                VerticalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}" 
                CellStyle="{DynamicResource DataGridCellStyle1}" 
                HorizontalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}"  
                IsSynchronizedWithCurrentItem="True" 
                CanUserSortColumns="False" 
                FontSize="12" 
                IsReadOnly="False" 
                AutoGenerateColumns="False"
                HeadersVisibility="Column" 
                CanUserReorderColumns="False"
                CanUserAddRows="False"
                DataContext="{Binding Source={StaticResource myData}}"
                ItemsSource="{Binding XPath=DataMark/ParaGroup[3]/Item}"
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding XPath=@Name}" Header="项目名称" Width="100*"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Mark}" Header="数据标识" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Data}" Header="数据域" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@ReviewType}" Header="操作类型" Width="80"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem Header="二类参数" Style="{DynamicResource TabItemStyle1}">
                <DataGrid  Name="Grid_SecondPara"             
                BorderBrush="{DynamicResource selectedStroke}" 
                RowHeight="24" 
                VerticalContentAlignment="Center" 
                BorderThickness="1" 
                RowStyle="{DynamicResource DataGridRowStyle1}" 
                VerticalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}" 
                CellStyle="{DynamicResource DataGridCellStyle1}" 
                HorizontalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}"  
                IsSynchronizedWithCurrentItem="True" 
                CanUserSortColumns="False" 
                FontSize="12" 
                IsReadOnly="False" 
                AutoGenerateColumns="False"
                HeadersVisibility="Column" 
                CanUserReorderColumns="False"
                CanUserAddRows="False"
                DataContext="{Binding Source={StaticResource myData}}"
                ItemsSource="{Binding XPath=DataMark/ParaGroup[4]/Item}"
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding XPath=@Name}" Header="项目名称" Width="100*"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Mark}" Header="数据标识" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Data}" Header="数据域" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@ReviewType}" Header="操作类型" Width="80"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <!--<TabItem Header="密钥下装" Style="{DynamicResource TabItemStyle1}">
                <DataGrid Name="Grid_MeterKeyDown"            
                BorderBrush="{DynamicResource selectedStroke}" 
                RowHeight="24" 
                VerticalContentAlignment="Center" 
                BorderThickness="1" 
                RowStyle="{DynamicResource DataGridRowStyle1}" 
                VerticalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}" 
                CellStyle="{DynamicResource DataGridCellStyle1}" 
                HorizontalGridLinesBrush="{DynamicResource TabControlNormalBorderBrush}"  
                IsSynchronizedWithCurrentItem="True" 
                CanUserSortColumns="False" 
                FontSize="12" 
                IsReadOnly="False" 
                AutoGenerateColumns="False"
                HeadersVisibility="Column" 
                CanUserReorderColumns="False"
                CanUserAddRows="False"
                DataContext="{Binding Source={StaticResource myData}}"
                ItemsSource="{Binding XPath=DataMark/ParaGroup[1]/Item}"
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding XPath=@Name}" Header="项目名称" Width="100*"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Mark}" Header="数据标识" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Data}" Header="数据域" Width="100"/>
                        <DataGridTextColumn Binding="{Binding XPath=@Review}" Header="复核" Width="80"/>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>-->
        </TabControl>

        <Grid Grid.Row="1" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100*" />
                <ColumnDefinition Width="90" />
                <ColumnDefinition Width="90" />
                <ColumnDefinition Width="100*" />
            </Grid.ColumnDefinitions>
            <Button Grid.Column="1" Name="btnOk" Content="应用" Width="80"  Click="Button_Click"  VerticalAlignment="Center" />
            <Button Grid.Column="2" Name="btnCancel" Content="取消" Width="80"  Click="Button_Click"  VerticalAlignment="Center"  />

        </Grid>
    </Grid>
</Window>